#include "programsettings.h"
#include "ui_programsettings.h"

ProgramSettings::ProgramSettings(QWidget *parent) :
    QTabWidget(parent),
    m_ui(new Ui::ProgramSettings)
{
    m_ui->setupUi(this);
    closeBtn = new QDialogButtonBox(QDialogButtonBox::Ok
                                      | QDialogButtonBox::Cancel);
    this->setCornerWidget(closeBtn);
    connect(closeBtn, SIGNAL(accepted()), this, SLOT(hide()));
}

ProgramSettings::~ProgramSettings()
{
    delete m_ui;
}

void ProgramSettings::changeEvent(QEvent *e)
{
    QTabWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

bool ProgramSettings::wordWrap()
{
    return this->m_ui->wordwrap->isChecked();
}

QFont ProgramSettings::editorFont()
{
    return this->m_ui->editorFont->font();
}
